﻿using HandyControl.Controls;
using Prism.Commands;
using Prism.Mvvm;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using wms_wpf.Apiservice;
using wms_wpf.InPut;

namespace wms_wpf.DialogViewModel
{
  public  class Dialog8ViewModel:BindableBase
    {

        public Dialog8ViewModel(IBaseService service)
        {
            this.service = service;
            ConfirmCommand = new DelegateCommand(Confirm);
            InPut_BaseService = new InPut_BaseService9();
        }
        private readonly IBaseService service;
        public DelegateCommand ConfirmCommand { get; set; }
        private InPut_BaseService9 inPut_BaseService;
        public InPut_BaseService9 InPut_BaseService
        {
            get { return inPut_BaseService; }
            set { inPut_BaseService = value; RaisePropertyChanged(); }
        }

        private async void Confirm()
        {
            bool res = InPut_BaseService.GetType().GetProperties().All(property => property.GetValue(InPut_BaseService) != null);
            if (!res)
            {
                Growl.Info("数据不完整！", "msg");
                return;
            }

            await service.Create_Inlethouse(InPut_BaseService);
       


        }
    }
}
